﻿@using EFmodel
@model List<User>
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
<div>
    <h1>简单的画一个表格展示数据</h1>
    <table border="1" cellpadding="0" cellspacing="0">
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>密码</th>
            <th>启用</th>
        </tr>
        @foreach( User user in Model )
        {
            <tr>
                <td>@user.Id</td>
                <td>@user.UserName</td>
                <td>@user.Password</td>
                <td>@user.IsUsed</td>
            </tr>
        }
    </table>
    <hr />
    <h1>增加</h1>
    <form action="@Url.Action("Add", "User")" method="POST">
        姓名:<input name="UserName" />
        密码:<input name="Password" />
        启用:<input name="IsUsed" />
        <button type="submit">提交</button>
    </form>
    <hr />
    <h1>修改</h1>
    <form action="@Url.Action("update", "User")" method="POST">
        Id:<input name="Id" />
        姓名:<input name="UserName" />
        密码:<input name="Password" />
        启用:<input name="IsUsed" />
        <button type="submit">提交</button>
    </form>
    <hr />
    <h1>删除</h1>
    <form action="@Url.Action("Delete", "User")" method="POST">
        Id:<input name="Id" />
        <button type="submit">提交</button>
    </form>
</div>
<div>
    <form action="@Url.Action("Index", "Role")" method="POST">
        <button type="submit">查看角色信息</button>
    </form>  
</div>
</body>
</html>
